<!--
 * @Author: your name
 * @Date: 2020-12-28 14:39:01
 * @LastEditTime: 2020-12-28 14:48:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basiccss\box\visiblity.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>visiblity</title>
    <style>
        article{
            padding: 30px;
            border: 2px solid red;
            width: 200px;
        }
        article>div{
            width: 100px;
            height: 100px;
            border: 2px solid red;
            padding: 20px;
            margin-bottom: 10px;
        }
        /*
            article元素下面的第一个div元素设置位隐藏
            设置位隐藏之后依然保留空间位
        */
        article div:nth-of-type(1){
            visibility: hidden;
            /* display: none; */
        }
    </style>
</head>
<body>
    <!--visiblity控制元素的显示隐藏,在隐藏后空间位也是保留的-->

    <article>
        <div></div>
        <div></div>
    </article>
    
</body>
</html>